{{- $lightgallery := .Page.Params.lightgallery | default site.Params.Page.lightgallery | default false -}}
{{- if .Title -}}
    <figure>
        {{- dict "Src" .Destination "Title" .Text "Caption" .Title "Linked" $lightgallery "Resources" .Page.Resources "Optim" true "Remote" true | partial "plugin/image.html" -}}
        <figcaption class="image-caption">
            {{- .Title | safeHTML -}}
        </figcaption>
    </figure>
{{- else -}}
    <figure>
        {{- dict "Src" .Destination "Title" .Text "Linked" $lightgallery "Resources" .Page.Resources "Optim" true "Remote" true | partial "plugin/image.html" -}}
    </figure>
{{- end -}}
